package cate.game.role.pvp.arena.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBArena;
import easy.java.dev.note.NoteField;
import easy.java.practice.errorcode.EcResult;

@ClientMsg(title = "跨服擂台赛-点赞大神 请求")
public class ArenaLikeTopReq implements MsgInput {
    @NoteField("大神UID")
    public String uid;

    @Override
    public MsgConfig conf() {
        return MsgIdBArena.LIKE_TOP_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<Void> r = cc.getRole().getPvp().arena.likeTop(uid);
        if (!r.ok()) {
            game.notice.message(cc.getRole(),r );
        } else {
            cc.getRole().getPvp().arena.noticeUpdate();
            cc.getRole().getPvp().arena.viewTopList();
        }
    }
}
